package com.itheima.controller;


import com.itheima.constant.MessageConstant;
import com.itheima.entity.Result;
import com.itheima.service.MemberService;
import com.itheima.service.ReportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 报表
 */
@Api(tags = "ReportController-报表相关接口")
@RestController
@RequestMapping("/report")
public class ReportController {
    @Autowired
    private MemberService memberService;


    @ApiOperation(value = "会员统计",notes = "会员统计")
    @GetMapping("/getMemberReport")
    public Result getMemberReport(){
        // 获取年月时间列表

        // 获取会员总数

        // 返回结果 months  memberCount
        return new Result(true, MessageConstant.GET_MEMBER_NUMBER_REPORT_SUCCESS,null);
    }

    //查询套餐预约占比数据统计
    @ApiOperation(value = "查询套餐预约占比数据统计",notes = "查询套餐预约占比数据统计")
    @GetMapping("/getSetmealReport")
    public Result getSetmealReport(){

        //调用Service查询


        //结果处理后封装到map集合
        //Map map = new HashMap();
        //map.put("setmealNames",setmealNames);
        //map.put("setmealCount",setmealCount);

        // 返回结果:setmealNames  setmealCount
        return new Result(true,MessageConstant.GET_SETMEAL_COUNT_REPORT_SUCCESS,null);
    }

    @Autowired
    private ReportService reportService;

    //获取运营数据统计
    @ApiOperation(value = "获取运营数据统计",notes = "获取运营数据统计")
    @GetMapping("/getBusinessReportData")
    public Result getBusinessReportData(){

        return new Result(true,MessageConstant.GET_BUSINESS_REPORT_SUCCESS, null);
    }

    //运营数据报表导出
    @ApiOperation(value = "运营数据报表导出",notes = "运营数据报表导出")
    @GetMapping("/exportBusinessReport")
    public Result exportBusinessReport(HttpServletRequest request, HttpServletResponse response){
        return null;
    }
}
